package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.wrongWord.CreateWrongWordBo;
import com.zhuss.bean.bo.core.wrongWord.DeleteWrongWordBo;
import com.zhuss.bean.bo.core.wrongWord.UpdateWrongWordBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.core.wrongWord.WrongWordOperateServiceExt;
import com.zhuss.exception.WpsException;


/**
 * @description: 敏感字操作的Controller
 * @author: zhushanshuo
 * @create: Fri Nov 20 13:10:22 CST 2020
 **/
@RestController
@RequestMapping("/wrongWord")
public class WrongWordOperateController extends BaseController {
	
	@Autowired
	@Qualifier("wrongWordOperateService")
	private OperateService<Void, Object> wrongWordOperateService;
	
	@Autowired
	@Qualifier("wrongWordOperateServiceExt")
	private WrongWordOperateServiceExt wrongWordOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateWrongWordBo bo) throws WpsException {
		
		wrongWordOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateWrongWordBo bo) throws WpsException {
		
		wrongWordOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteWrongWordBo bo) throws WpsException {
		
		wrongWordOperateService.delete(bo);
    }
	
}
